package com.code.base.log.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.log.persistence.LogSpTrdMapper;
import com.code.base.log.pojo.LogSpTrd;
import com.code.util.PrimaryKeyUtil;


@Service
public class LogSpTrdService {


	@Resource
	private LogSpTrdMapper logSpTrdMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public LogSpTrd getDataById(Long id) {
		return logSpTrdMapper.getDataById(id);
	}

	public List<LogSpTrd> getAllData() {
		return logSpTrdMapper.getAllData();
	}

	public int getDataCountByCondition(LogSpTrd entity) {
		return logSpTrdMapper.getDataCountByCondition(entity);
	}

	public List<LogSpTrd> getDataByCondition(LogSpTrd entity) {
		return logSpTrdMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(LogSpTrd entity) {
		return logSpTrdMapper.getDataCountByLikeCondition(entity);
	}

	public List<LogSpTrd> getDataByLikeCondition(LogSpTrd entity) {
		return logSpTrdMapper.getDataByLikeCondition(entity);
	}

	public List<LogSpTrd> getDataByIds(Long[] ids) {
		return logSpTrdMapper.getDataByIds(ids);
	}

	public void insertData(LogSpTrd entity) {
		insertData(entity, true);
	}

	public void insertData(LogSpTrd entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		logSpTrdMapper.insertData(entity);
	}

	public void updateData(LogSpTrd entity) {
		logSpTrdMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		logSpTrdMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(LogSpTrd entity) {
		logSpTrdMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		logSpTrdMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		logSpTrdMapper.deleteDataByIds(ids);
	}

}
